﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace HRProject.Component.Base
{
    public partial class AddButton : System.Web.UI.UserControl
    {
        private string[] allowRoles = new string[]{};

        public string[] AllowRoles
        {
            get { return allowRoles; }
            set { allowRoles = value; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            bool auth = false;
            foreach (string role in allowRoles)
            {
                if (Roles.IsUserInRole(role))
                {
                    auth = true;
                    break;
                }
            }
            Visible = auth;
        }
    }
}